Action hook 'delete_site_transient_{$transient}'

in WP Core File wp-includes/option.php at line 2503

View Source

delete_site_transient_{$transient}

Action Hook
Description
Fires immediately before a specific site transient is deleted. The dynamic portion of the hook name, `$transient`, refers to the transient name.

Hook Information

File Location wp-includes/option.php View on GitHub
Hook Type Action
Line Number 2503

Hook Parameters

Type Name Description
string $transient Transient name.

Usage Examples

Basic Usage
<?php
// Hook into delete_site_transient_{$transient}
add_action('delete_site_transient_{$transient}', 'my_custom_function', 10, 1);

function my_custom_function($transient) {
    // Your custom code here
}

Source Code Context

wp-includes/option.php:2503 - How this hook is used in WordPress core
<?php
2498  	 *
2499  	 * @since 3.0.0
2500  	 *
2501  	 * @param string $transient Transient name.
2502  	 */
2503  	do_action( "delete_site_transient_{$transient}", $transient );
2504  
2505  	if ( wp_using_ext_object_cache() || wp_installing() ) {
2506  		$result = wp_cache_delete( $transient, 'site-transient' );
2507  	} else {
2508  		$option_timeout = '_site_transient_timeout_' . $transient;

PHP Documentation

<?php
/**
	 * Fires immediately before a specific site transient is deleted.
	 *
	 * The dynamic portion of the hook name, `$transient`, refers to the transient name.
	 *
	 * @since 3.0.0
	 *
	 * @param string $transient Transient name.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/option.php
Related Hooks

Related hooks will be displayed here in future updates.